{include file='header.html'}
<link type="text/css" href="../../page/css/reset.css" rev="stylesheet" rel="stylesheet">
<link type="text/css" href="../../page/css/examine.css" rev="stylesheet" rel="stylesheet">
<link type="text/css" href="{$common_domain}/tools/datepicker/jquery.ui.theme.css" rel="stylesheet" />
<link type="text/css" href="{$common_domain}/tools/datepicker/jquery.ui.datepicker.css" rel="stylesheet" />
<link type="text/css" href="{$common_domain}/tools/datepicker/jquery-ui-1.8.16.custom.css" rel="stylesheet" />
<script type="text/javascript" src="{$common_domain}/tools/datepicker/jquery-1.7.2.js"></script>
<script type="text/javascript" src="{$common_domain}/tools/datepicker/jquery.ui.core.js"></script>
<script type="text/javascript" src="{$common_domain}/tools/datepicker/jquery.ui.widget.js"></script>
<script type="text/javascript" src="{$common_domain}/tools/datepicker/jquery.ui.datepicker.js"></script>
<script type="text/javascript" src="{$common_domain}/tools/datepicker/DateTimePicker.js"></script>
<script type="text/javascript">

$(function () {
    $("#start_time").datetimepicker();
    $("#end_time").datetimepicker();
    $("#keywords").attr("placeholder","请输入姓名或工号");
    $("#search").bind('click',function(){
        var str ="";
        $("#selectCopy input").each(function(i){
            if($(this).attr("checked")){
                str += $(this).val()+",";
            }
        });
        var reg=/,$/gi;
        str=str.replace(reg,"");
        $("#cityId").val(str);
        $.ajax({
          type: 'POST',
          url: "/ajax/",
          data: "city="+str+"&do=get_depart",
          dataType: 'json',
          success: function(data){
            if(data){
                var test = data;
                $("#apart").html("");
                $("#apart").append('<option value="0">所有部门</option>');
                for(var i=0;i<test.length;i++){
                    var option = $("<option id="+test[i].department_id+" value="+test[i].department_name+">"+test[i].department_name+"</option>")
                    $("#apart").append(option);
                    }
                }
            }
        });

        $("#search").hide();
        $("#selectCopy").hide();
    });
});
</script>
<div id="content">
    <i class="con_l">&nbsp;</i>
    <i class="con_r">&nbsp;</i>
    <div class="main">
        <div class="blank"></div>
        <ul class="p p2">
        <form id="form1" action="/examine/" method="post" enctype="multipart/form-data">
            <li class="one">
                <input type="text" readonly="readonly" value="{$params.start_time}"  class="jko notime" name="start_time" id="start_time"/>
                至
                <input type="text" readonly="readonly" value="{$params.end_time}" class="jko notime" name="end_time" id = "end_time"/>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="text" onfocus="$('#selectCopy').show();$('#search').show();" id="cityId" class="selectStyle" value="城市">

                </input>
                <select class="apart" id="apart" name="apart">
                <option value="0">所有部门</option>
                    {if $def_depart}
                    {foreach name=depart_list from=$def_depart key=k item=d}
                    <option value="{$d.department_name}" {if $d.department_name==$def_depart_name}selected="selected"{/if}>{$d.department_name}</option>
                    {/foreach}
                    {/if}
                </select>
                <input value="{if $params['keywords'] neq null}{$params['keywords']}{/if}" type="text" id="keywords" name="keywords" style="position:absolute;width:147px;margin-top:1px;right:140px"/>
                <input class="btn" type="submit" value="搜索" />
            </li>

            <ul class="selectCopy" id="selectCopy">
            {foreach name=city_list from=$city_list key=k item=d}
                <li>
                    <input type="checkbox" name="city[]" value="{$d}" {if $d|in_array:$check_city}checked="checked"{/if}>{$d}
                </li>
            {/foreach}
            </ul>
            </form>
            <input type="button" id="search" style="position: absolute;width: 67px;height: 28px;top:243px;right:490px;display: none;" value="go">
            <li class="s fir">
                <i class="i0 y2">员工姓名</i>
                <i class="i0 y3">工号</i>
                <i class="i0 y4">部门</i>
                <i class="i0 y5">申请类型</i>
                <i class="i0 i5">天数</i>
                <i class="i0 y6">申请时间</i>
                <i class="i0 y7">提交时间</i>
                <i class="i0 y9">状态</i>
                <div class="clear">riqi</div>
            </li>
            <li class="info">
                {foreach from=$datalist item=list}
                <span class="list">
                    <i class="list_s t">{$list.userinfo.name}</i>
                    <i class="list_s t1">{$list.userinfo.code}</i>
                    <i class="list_s t2">{$list.userinfo.department_name}</i>
                    <i class="list_s t3">{$list.type}</i>
                    <i class="list_s t4">{if $list.type eq '公出'}{$list.leave_time} (小时){else}{$list.leave_time}{/if}</i>
                    <i class="list_s t5">{$list.start_time}&nbsp;至&nbsp;{$list.end_time}
                    </i>
                    <i class="list_s t6">{$list.apply_time}</i>
                    <i class="list_s t7 {if $list.status eq '未审核'}false{/if}">{$list.status}</i>
                </span>
                {/foreach}

               <div class="p p3" style="text-align:center;margin:10px 0;" align="center">
                        {include file='multipage.html'}
                    </div>
            </li>
            <li></li>
        </ul>

    </div>
</div>